<?php

namespace app\adminapi\controller\v1\portal;

use app\adminapi\controller\AuthController;
use app\services\portal\PortalShoolDescService;
use think\facade\App;

/**
 * 学校介绍
 */
class PortalSchoolDesc extends AuthController
{

    public function __construct(App $app ,PortalShoolDescService $service)
    {
        parent::__construct($app);
        $this -> services = $service;
    }


    public function index(){
        $where = $this->request->postMore([
            ['website_id',$this  -> website],
        ]);
        return app() -> make('json') -> successful($this -> services -> index($where));
    }


    public function createOrUpdate(){
        $where = $this->request->postMore([
            ['website_id',$this  -> website],
            ['id',0],
            ['title',''],
            ['content',''],
        ]);
        return app() -> make('json') -> successful($this -> services -> update($where));
    }




}